<template>
  <div class="box">
     <div class="header-border">
      <div class="nav nav-childer" :style="getfontsize">
        <div class="button-b" >
            <slot name="up"></slot>
        </div>
        <div class="header-bottom">
          <div @click="navchoose(index)"  :class="[index==0?'clear':'Sure',indexbutton===index?'active':'']" v-for="(item,index) in buttons" :key="index">{{item}}</div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data () {
    return {
      buttons: ['清空', '确定'],
      indexbutton: 3
    }
  },
  props:{
    width:{
      type:Number,
      default:406
    }
  },
  computed:{
    getfontsize(){
      let buildingwidth = this.width ? 'width:'+this.width+'px':''
      return `${buildingwidth}`
    }
  },
  methods: {
    navchoose (i) {
      this.indexbutton = i
      this.$emit('setAccess',i)
    }
  }
}
</script>

<style lang="scss">
  .active{
    background-color: rgba(255, 150, 45, 100);
    color: rgba(255, 255, 255, 100) !important;
    border: 1px solid rgba(187, 187, 187, 100);
  }
  .button-b{
    padding-bottom: 53px;
  }
  .box{
    .nav{
      border:1px solid #bbbbbb
    }
    .header-border{
      height: 600px;
      padding:6px;
      .nav-childer{
        width:406px;
        min-height: 203px;
        border-radius: 10px;
        .header-top{
          padding:37px 20px 0 28px;
          display: flex;
          justify-content: space-between;
          align-items: center;
          span{
            color: rgba(115, 105, 105, 100);
            font-size: 14px;
            text-align: left;
            font-family: SourceHanSansSC-regular;
            padding-right:36px;
          }
          input{
            width: 200px;
            height: 30px;
            text-align: left;
            border: 1px solid rgba(187, 187, 187, 100);
          }
        }
        .header-bottom{
          padding-left:70px;
          display: flex;
          padding-bottom: 33px;
          .clear{
            margin-right: 72px;
          }
          div{
            width: 80px;
            height: 30px;
            border-radius: 4px;
            color: rgba(16, 16, 16, 100);
            font-size: 14px;
            text-align: center;
            font-family: Microsoft Yahei;
            border: 1px solid rgba(187, 187, 187, 100);
            line-height: 30px;
            cursor: pointer;
          }
        }
      }
    }
  }
</style>
